package com.yonyou.pmclouds.personnel.process;

import com.yonyou.pmclouds.basecom.bp.processor.MultiProcessor;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.personnel.entity.PersonnelVO;

/**
 * @Author chulf
 * @Date 2020/4/17
 * @Description 删除 校验用户是否已取消授权
 **/
public class DeleteCheckBeforeProcess implements MultiProcessor<PersonnelVO> {

    public static final Integer IS_YGC_AUTHOR = 1;
    @Override
    public void process(PersonnelVO[] vos, PersonnelVO[] origs) throws BusinessException {

        for (PersonnelVO vo : vos) {
            if (vo.getIsYgcAuthorizer() == IS_YGC_AUTHOR) {

                throw new BusinessException("删除企业人员包含已授权用户，删除失败！");
            }
        }
    }
}
